package com.hbnu.service;

import com.hbnu.Dao.UserDao;

import javax.annotation.Resources;

public class UserService {
    @Resources(name="userDao")
    private UserDao userDao;

    //    可以通过有参构造方式或setter方式注入，常用的是setter方式
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void addUser() {
        System.out.println("add user by userService ......");
        userDao.addUser();
    }
}
